package com.neusoft.hifly.rpc.app.dao;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.neusoft.hifly.core.pojo.ApiResponse;
import com.neusoft.hifly.rpc.app.dao.fallback.DatasourceFallback;
import com.neusoft.hifly.rpc.app.domain.DatasourceDTO;

/**
 * Title: 统一用户服务
 * <p>
 * Description: 数据源接口
 * <p>
 * Copyright: 2019
 * <p>
 * Company: 东软汉枫
 *
 * @author lh_neu
 * @version 1.0.0
 */
@FeignClient(value = "ctcloud-tenant", fallbackFactory = DatasourceFallback.class)
public interface IDatasourceDao {

	/**
	 * 通过逻辑ID获取数据源
	 *
	 * @param logicId
	 *            数据源逻辑ID
	 * @return 默认策略
	 */
	@RequestMapping(value = "/tenant/api/v1/datasource/{logicId}", method = RequestMethod.GET)
	<T extends DatasourceDTO> ApiResponse<T> getByLogicId(@RequestParam("logicId") final long logicId);

}
